package com.zxy.house.service.impl;

import com.zxy.house.vo.HouseEntityVo;
import com.zxy.house.vo.HouseVo;
import com.zxy.house.vo.impl.HousesVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zxy.common.utils.PageUtils;
import com.zxy.common.utils.Query;

import com.zxy.house.dao.HouseDao;
import com.zxy.house.entity.HouseEntity;
import com.zxy.house.service.HouseService;
import org.springframework.ui.Model;


@Service("houseService")
public class HouseServiceImpl extends ServiceImpl<HouseDao, HouseEntity> implements HouseService {

    @Autowired
    private HouseDao houseDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<HouseEntity> page = this.page(
                new Query<HouseEntity>().getPage(params),
                new QueryWrapper<>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<HousesVo> newHouseList(HouseVo houseVo, Integer page, Integer size) {
        List<HousesVo> housesVos = houseDao.HouseList(houseVo,page,size);
        return housesVos ;
    }

}